<?php
session_start();
include_once("../ClassesControle/Controle.Busca.php");
$control = new Controle();
include_once("../Classes/Funcionario.php");
$funcionario = new Funcionario();
$funcionario =  unserialize($_SESSION["user"]);
$control->retornaDemanda($_POST["tipo"],$_POST["parametro1"],$_POST["parametro2"],$_POST["qtde"], $funcionario)
?>
<table id="tabeladeResulstados" width="580" border="0">
  <tr>
    <td>nº Nota/SSP</td>
    <td>Descrição</td>
    <td>Area Resp.</td>
    <td>Data Entrega</td>
    <td>Visualizar</td>
  </tr>
  <?php foreach($control->lista as $demanda){ ?>
  <tr>
    <td><? echo $demanda->getAreaResponsabilidade(); ?>-<? echo substr($demanda->getNumero(),0,2); ?>/<? echo substr($demanda->getNumero(),2); ?></td>
    <td><? echo $demanda->getDescricao(); ?></td>
    <td></td>
    <td><? echo substr($demanda->getDataEntrega(),0,2); ?>/<? echo substr($demanda->getDataEntrega(),2,2); ?>/<? echo substr($demanda->getDataEntrega(),4,4); ?></td>
    <td><a href="#" lang="<?php echo $demanda->getNumero(); ?>"><img class="visualizarDemandaCompleta" src="imagens/1320276854_Preview Docment.png" /></a></td>
  </tr>
  <?php }?>
  </table>
  <table width="580">
   <tr>
   <?php if($control->qtdeRetorno != -1){ ?>
    <td align="right"><a href="#" class="voltarPaginaPesquisa" lang="<?php echo $control->qtdeRetorno; ?>">
    <img src="imagens/1320530984_gtk-media-next-ltr2.png"></a>
    </td>
    <? } ?>
    <?php if($control->qtde != -1){ ?>
    <td>
    <a href="#" class="proximaPaginaPesquisa" lang="<?php echo $control->qtde; ?>">
    <img src="imagens/1320530984_gtk-media-next-ltr.png"></a>
    </td>
    <? } ?> 
  </tr>
</table>

